﻿using System;

namespace DuckFlyWithInterface
{
    interface IFlyBehavior
    {
        public void Fly();
    }

    public class FlyWithWings : IFlyBehavior
    {
        public void Fly()
        {
            Console.WriteLine("用翅膀飞！");
        }
    }
    public class FlyWithNoWay : IFlyBehavior
    {
        public void Fly()
        {
            Console.WriteLine("不能飞！");
        }
    }
    public class FlyWithRocket : IFlyBehavior
    {
        public void Fly()
        {
            Console.WriteLine("乘坐火箭飞！");
        }
    }
    //新接口
    interface IQuackBehavior
    {
        public void Quack()
        {
        Console.WriteLine("鸽子呱呱叫");
        }
    }
    public class NormalQuack : IQuackBehavior
    {
        public void Quack()
        {
            Console.WriteLine("鸭子呱呱叫！");
        }
    }
    public class MuteQuack : IQuackBehavior
{
    public void Quack()
    {
        Console.WriteLine("沉默，不会叫！");
    }
}

public class SqueakQuack : IQuackBehavior
{
    public void Quack()
    {
        Console.WriteLine("橡皮鸭吱吱叫！");
    }
}
interface ISwimBehavior
{
    public void Swim();
}
//游泳
public class NormalSwim : ISwimBehavior
{
    public void Swim()
    {
        Console.WriteLine("正常游泳！");
    }
}

public class NoSwim : ISwimBehavior
{
    public void Swim()
    {
        Console.WriteLine("不会游泳！");
    }
}
public class FloatSwim : ISwimBehavior
{
    public void Swim()
    {
        Console.WriteLine("漂浮在水面上！");
    }
}
}